<!-- home -->
<template>
  <div class="about-container">
    <div class="warpper">
      <div class="ownInfo">
        <div>
          <img v-if="userInfo.avatar" :src="userInfo.avatar" class="ownPhoto" />
          <img v-else src="@/assets/images/avatar.png" class="ownPhoto" />
        </div>
        <div class="userWork">
          <div class="username">{{ userInfo.name }}</div>
          <div class="userInfo">{{ userInfo.department }}</div>
        </div>
      </div>
      <div class="tabs">
        <van-tabs @click="onClick">
          <van-tab title="追踪">
            <div class="tabsBox_content">
              <div class="tab_container">
                <div class="tab_indexTitle">
                  13月继续率-张家口-个人营销
                </div>
                <div class="indexParameters">
                  <div class="indexParame_Number">75.2%</div>
                  <div class="indexParame_Time">2021/06/28 21:30</div>
                </div>
                <div class="tab_footerButtons">
                  <div class="end_track">结束追踪</div>
                  <div class="remind_who">@谁</div>
                </div>
              </div>
               <div class="tab_container">
                <div class="tab_indexTitle">
                  13月继续率-张家口-个人营销
                </div>
                <div class="indexParameters">
                  <div class="indexParame_Number">75.2%</div>
                  <div class="indexParame_Time">2021/06/28 21:30</div>
                </div>
                <div class="tab_footerButtons">
                  <div class="end_track">结束追踪</div>
                  <div class="remind_who">@谁</div>
                </div>
              </div>
               <div class="tab_container">
                <div class="tab_indexTitle">
                  13月继续率-张家口-个人营销
                </div>
                <div class="indexParameters">
                  <div class="indexParame_Number">75.2%</div>
                  <div class="indexParame_Time">2021/06/28 21:30</div>
                </div>
                <div class="tab_footerButtons">
                  <div class="end_track">结束追踪</div>
                  <div class="remind_who">@谁</div>
                </div>
              </div>
                <div class="tab_container">
                <div class="tab_indexTitle">
                  13月继续率-秦皇岛-顾问营销
                </div>
                <div class="indexParameters">
                  <div class="indexParame_Number">75.2%</div>
                  <div class="indexParame_Time">2021/06/28 21:30</div>
                </div>
                <div class="tab_footerButtons">
                  <div class="end_track">结束追踪</div>
                  <div class="remind_who">@谁</div>
                </div>
              </div>
            </div>
          </van-tab>
          <van-tab title="@我">
               <div class="tabsBox_content">
              <div class="tab_container">
                <div class="tab_indexTitle">
                  13月继续率-秦皇岛-顾问营销
                </div>
                <div class="indexParameters">
                  <div class="indexParame_Number">75.2%</div>
                  <div class="indexParame_Time">2021/06/28 21:30</div>
                </div>
                <div class="tab_footerButtons">
                  <div class="end_track">结束追踪</div>
                  <div class="remind_who">@谁</div>
                </div>
              </div>
               <div class="tab_container">
                <div class="tab_indexTitle">
                  13月继续率-廊坊-顾问营销
                </div>
                <div class="indexParameters">
                  <div class="indexParame_Number">75.2%</div>
                  <div class="indexParame_Time">2021/06/28 21:30</div>
                </div>
                <div class="tab_footerButtons">
                  <div class="end_track">结束追踪</div>
                  <div class="remind_who">@谁</div>
                </div>
              </div>
               <div class="tab_container">
                <div class="tab_indexTitle">
                  13月继续率-张家口-个人营销
                </div>
                <div class="indexParameters">
                  <div class="indexParame_Number">75.2%</div>
                  <div class="indexParame_Time">2021/06/28 21:30</div>
                </div>
                <div class="tab_footerButtons">
                  <div class="end_track">结束追踪</div>
                  <div class="remind_who">@谁</div>
                </div>
              </div>
                <div class="tab_container">
                <div class="tab_indexTitle">
                  13月继续率-张家口-个人营销
                </div>
                <div class="indexParameters">
                  <div class="indexParame_Number">75.2%</div>
                  <div class="indexParame_Time">2021/06/28 21:30</div>
                </div>
                <div class="tab_footerButtons">
                  <div class="end_track">结束追踪</div>
                  <div class="remind_who">@谁</div>
                </div>
              </div>
            </div>
          </van-tab>
        </van-tabs>
      </div>
    </div>
  </div>
</template>

<script>
import { getUserInfo } from '@/api/user'
export default {
  data() {
    return {
      userInfo: {}
      // username: '萧晓',
      // userInfo: '科技赋能/数据资产治理办公室/工程师'
    }
  },
  computed: {},
  mounted() {
    if (this.$store.getters.userInfo) {
      this.userInfo = this.$store.getters.userInfo
    } else {
      this.getUserInfo()
    }
  },
  methods: {
    onClick(event) {
      console.log('event', event)
    },
    lookDetails() {
      this.$router.push({ path: '/aboutDetails' })
    },
    endTrack() {
      this.$toast.success('结束追踪')
    },
    async getUserInfo() {
      const res = await getUserInfo()
      if (res.value) {
        this.userInfo = res.value
        this.$store.commit('SET_USERINFO', res.value)
      }
    }
  }
}
</script>
<style lang="scss" scoped>
.about-container {
  height: 100vh;
  box-sizing: border-box;
  .warpper {
    .ownInfo {
      width: 339px;
      height: 101px;
      display: flex;
      margin: 17px auto 0px;
      border-radius: 8px;
      padding: 25px 19px;
      background: #192264;
      margin-bottom: 8px;
      box-shadow: 0px 8px 40px -32px rgba(9, 15, 23, 0.04);
      .ownPhoto {
        height: 50px;
        width: 50px;
        box-shadow: 0px 4px 10px 0px rgba(232, 232, 232, 0);
      }
      .userWork {
        margin-top: 2px;
        margin-left: 12px;
        .username {
          font-size: 18px;
          line-height: 25px;
        }
        .userInfo {
          font-size: 14px;
          font-weight: 400;
          color: #7981bf;
          line-height: 20px;
        }
      }
    }
    /deep/.tabs {
      .van-tabs__wrap {
        border-bottom: 1px solid rgba(244, 244, 244, 0.1);
      }
      .van-tab {
        background-color: #151847;
      }
      .van-tab__text--ellipsis {
        color: #d6ddff;
      }
      .van-tabs__nav {
        background-color: #151847;
        width: 180px;
      }
      .van-tabs__line {
        background-color: #fff;
        height: 2px;
      }
      .van-info {
        right: -10px;
      }
    }
    .tabsBox_content{
      padding-top: 12px;
      padding-bottom: 50px;
      .tab_container {
      width: 339px;
      margin: 0px auto 16px;
      background: #192264;
      box-shadow: 0px 8px 40px -32px rgba(9, 15, 23, 0.04);
      border-radius: 8px 8px 0px 0px;
      .tab_indexTitle {
        font-size: 18px;
        line-height: 25px;
        font-weight: 600;
        padding: 20px 20px 0px 20px;
      }

      .indexParameters {
        display: flex;
        justify-content: space-between;
        padding: 20px 20px 0px 20px;
        .indexParame_Number {
          font-size: 28px;
          font-weight: normal;
          color: #ffb440;
          line-height: 38px;
        }
        .indexParame_Time {
          font-size: 12px;
          font-weight: 400;
          color: #9798b3;
          line-height: 17px;
          padding-top: 12px;
        }
      }

      .tab_footerButtons {
        display: flex;
        justify-content: space-between;
        line-height: 46px;
        border-top: 1px solid #0c144b;
        .end_track {
          width: 169px;
          border-right: 1px solid #0c144b;
          text-align: center;
          font-size: 14px;
        }
        .remind_who {
          width: 169px;
          text-align: center;
          font-size: 14px;
        }
      }
    }
    }
  }
}
</style>
